include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
include $(RTEMS_CUSTOM)
include $(PROJECT_ROOT)/make/leaf.cfg

BIN=${ARCH}/testBase.bin
EXEC=testBase.exe
PGM=${ARCH}/$(EXEC)

# optional managers required
MANAGERS=all

# C source names
CSRCS = $(wildcard ./*.c)
COBJS = $(patsubst %.c,${ARCH}/%.o,$(CSRCS)) $(patsubst %.s,${ARCH}/%.o,$(CSRCS))

SSRCS = $(wildcard ./*.s)
SOBJS = $(patsubst %.s,${ARCH}/%.o,$(SSRCS))

OBJS= $(COBJS) $(SOBJS)

all:    ${ARCH} $(PGM) $(BIN)

$(PGM): $(OBJS)
	$(make-exe)
$(BIN): $(PGM)
	$(OBJCOPY) -O binary $^ $@
${ARCH}/%.o: %.s
	${COMPILE.c} $(AM_CPPFLAGS) $(AM_CXXFLAGS) -o $@ $<
CFLAGS +=
CPPFLAGS +=
LDFLAGS += -fwhole-program -Wl,--gc-sections -fno-exceptions